#include "widget.h"
#include "ui_widget.h"
#include <QResizeEvent>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    //先把QLable 设置成窗口一样大，并把这个QLable左上角设置到窗口左上角
    //ui->label->setGeometry(0,0,800,600);

    QRect windowRect = this->geometry();
    ui->label->setGeometry(0,0,windowRect.width(),windowRect.height());

    QPixmap pixmap(":/andriod.png");
    ui->label->setPixmap(pixmap);

    //启动自动拉伸，此时图片就能充满整个窗口了
    ui->label->setScaledContents(true);
}



void Widget::resizeEvent(QResizeEvent *event)
{
    ui->label->setGeometry(0,0,event->size().width(),event->size().height());
}

Widget::~Widget()
{
    delete ui;
}

